<?php

namespace app\index\controller;

use think\facade\Hook;
use think\facade\App;
use think\Container;
use app\common\service\InvokerTest;
use app\common\model\Message;
use think\Db;
use think\Build;
use bqs\validate\Check;
use think\Facade\Log;

class DouBan
{
    public function index()
    {
        return '<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} a{color:#2E5CD5;cursor: pointer;text-decoration: none} a:hover{text-decoration:underline; } body{ background: #fff; font-family: "Century Gothic","Microsoft yahei"; color: #333;font-size:18px;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.6em; font-size: 42px }</style><div style="padding: 24px 48px;"> <h1>:) </h1><p> ThinkPHP V5.1<br/><span style="font-size:30px">12载初心不改（2006-2018） - 你值得信赖的PHP框架</span></p></div><script type="text/javascript" src="https://tajs.qq.com/stats?sId=64890268" charset="UTF-8"></script><script type="text/javascript" src="https://e.topthink.com/Public/static/client.js"></script><think id="eab4b9f840753f8e7"></think>';
    }

    public function search()
    {
        $keyword = input('keyword');

        $movie = [
            [
                "images" => [
                    "large" => "https://resources.huanhuanhuishou.com/global_source/FDB5443A-2025-B0E3-435A-D85F97DF412F.png"
                ],
                "title" => "差别巨大电影",
                "rating" => [
                    "average" => 15
                ],
                "alt" => "天青石鲈鱼"
            ],
            [
                "images" => [
                    "large" => "https://resources.huanhuanhuishou.com/global_source/8C7047CE-2E11-A06F-B76C-D3BE86D45C4D.png"
                ],
                "title" => "差别巨大电影2",
                "rating" => [
                    "average" => 1
                ],
                "alt" => "天青石鲈鱼"
            ],
            [
                "images" => [
                    "large" => "https://resources.huanhuanhuishou.com/global_source/B09A43C3-A457-35F8-E393-EC205309DAF5.png"
                ],
                "title" => "差别巨大电影3",
                "rating" => [
                    "average" => 22
                ],
                "alt" => "天青石鲈鱼"
            ],
            [
                "images" => [
                    "large" => "https://resources.huanhuanhuishou.com/global_source/D7B84C45-9E90-C597-EF8C-D7D6383912D7.png"
                ],
                "title" => "差别巨大电影4",
                "rating" => [
                    "average" => 33
                ],
                "alt" => "天青石鲈鱼"
            ],
            [
                "images" => [
                    "large" => "https://resources.huanhuanhuishou.com/global_source/1812BD9B-2353-85C8-130C-E5B6EFA8267B.png"
                ],
                "title" => "差别巨大电影5",
                "rating" => [
                    "average" => 44
                ],
                "alt" => "天青石鲈鱼"
            ],
            [
                "images" => [
                    "large" => "https://resources.huanhuanhuishou.com/global_source/59B4ADF6-23F7-674E-D35A-F6895A55AF4A.png"
                ],
                "title" => "差别巨大电影6",
                "rating" => [
                    "average" => 55
                ],
                "alt" => "天青石鲈鱼"
            ],
            [
                "images" => [
                    "large" => "https://resources.huanhuanhuishou.com/global_source/EA9A4435-92C4-5E81-E365-17B85DE89C7E.png"
                ],
                "title" => "差别巨大电影7",
                "rating" => [
                    "average" => 66
                ],
                "alt" => "天青石鲈鱼"
            ]
        ];

        $movieArr = $movie[mt_rand(0, 6)];

        return json(["subjects" => [$movieArr]]);

        return "hello world";
    }

}
